<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function User(name, age) {
        this.name = name;
        this.age = age;
      }
      User.prototype.show = function () {
        console.log(this.name, this.age);
      };

      function Admin(name, age) {
        let instance = Object.create(User.prototype);
        User.call(instance, name, age);
        instance.role = function () {
          console.log("admin.role");
        };
        return instance;
      }

      let hd = Admin("厚度人", 19);
      hd.show();
    </script>
  </body>
</html>
